package com.atguigu.spring6.iocxml.life;

public class User {

    private String name;

    public User() {
        System.out.println("1 bean对象创建，调用无参数构造");
    }


    public void initMethod() {
        System.out.println("4 bean对象初始化 调用指定初始化方法");
    }

    @Override
    public String toString() {
        return "*toString方法:" + "User{" +
                "name='" + name + '\'' +
                '}';
    }

    public void destroyMethod() {
        System.out.println("7 bean对象销毁，调用指定销毁方法");
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        System.out.println("2 给bean对象设置属性值");
        this.name = name;
    }
}